@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-6  col-sm-offset-3">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>工具类</h5>
            </div>
            <div class="ibox-content">
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">解密结果</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="decode">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">加密结果</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="encode">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" onclick="encode();">加密</button>
                            <button class="btn btn-primary" onclick="decode();">解密</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/js/base64.js"></script>
<script>
        function encode() {
            var str = $("#decode").val();
            var base = new Base64();
            var result = base.encode(str);
            $("#encode").val(result);
            console.log(result);
        }
        function decode() {
            var str = $("#encode").val();
            var base = new Base64();
            var result = base.decode(str);
            $("#decode").val(result);
            console.log(result);
        }

</script>
@}
